<%@page pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@taglib prefix="f" uri="http://www.slim3.org/functions"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script
	src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js">
	
</script>
<link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="/lib/bootstrap/css/bootstrap-responsive.min.css">
<link rel="stylesheet" href="/css/global.css">
<link rel="stylesheet" href="/css/schedule.css">
<title>TwitCockpit α</title>
</head>
<body>
	<div class="topbar" data-dropdown="dropdown">
		<div class="navbar navbar-fixed-top">
			<div class="navbar-inner">
				<div class="container-fluid">
					<a class="brand" href="/">TwitCockpit α</a>
					<div class="nav-collapse">
						<ul class="nav">
							<li><a href="/cockpit/">Cockpit</a></li>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span3">
				<script src="http://widgets.twimg.com/j/2/widget.js">
					
				</script>
				<script>
					new TWTR.Widget({
						version : 2,
						type : 'search',
						search : '#ChugokuGTUG',
						interval : 30000,
						title : 'ChugokuGTUG',
						subject : '',
						width : 220,
						height : 600,
						theme : {
							shell : {
								background : '#f5f5f5',
								color : '#444444'
							},
							tweets : {
								background : '#ffffff',
								color : '#444444',
								links : '#1985b5'
							}
						},
						features : {
							scrollbar : true,
							loop : true,
							live : true,
							hashtags : true,
							timestamp : true,
							avatars : true,
							toptweets : true,
							behavior : 'default'
						}
					}).render().start();
				</script>
			</div>
			<div class="span9">
				<form method="post" action="/twitter/tweet">
					<fieldset>
						<legend>Tweet</legend>
						<div class="control-group">
							<div class="controls">
								<textarea name="tweet"></textarea>
								<p class="help-block">つぶやくボタンを押すと、すぐさま @chugokugtug が呟きます。</p>
							</div>
						</div>

						<input type="submit" value="つぶやく"></input>
					</fieldset>
				</form>
				<c:forEach var="e" items="${f:errors()}">
					<li>${f:h(e)}</li>
				</c:forEach>
				<form class="form-horizontal" method="post"
					action="/cockpit/schedule/entry" id="entryForm">
					<fieldset>
						<legend>定期Post設定</legend>
						<div class="control-group">
							<label class="control-label" for="select01">つぶやく内容</label>
							<div class="controls">
								<textarea name="tweet"></textarea>
							</div>
						</div>
						<div class="control-group">
							<label class="control-label" for="inlineCheckboxes">曜日</label>
							<div class="controls">
								<label class="checkbox inline"> <input type="checkbox"
									name="weekCheckbox1" value="1">日
								</label> <label class="checkbox inline"> <input type="checkbox"
									name="weekCheckbox2" value="2">月
								</label> <label class="checkbox inline"> <input type="checkbox"
									name="weekCheckbox3" value="3">火
								</label> <label class="checkbox inline"> <input type="checkbox"
									name="weekCheckbox4" value="4">水
								</label> <label class="checkbox inline"> <input type="checkbox"
									name="weekCheckbox5" value="5">木
								</label> <label class="checkbox inline"> <input type="checkbox"
									name="weekCheckbox6" value="6">金
								</label> <label class="checkbox inline"> <input type="checkbox"
									name="weekCheckbox7" value="7">土
								</label>
							</div>
						</div>
						<div class="control-group">
							<label class="control-label" for="startdate">開始日</label>
							<div class="controls">
								<select class="yearbox" name="startyear">
									<option>2012</option>
									<option>2013</option>
									<option>2014</option>
									<option>2015</option>
								</select>年 <select class="span1" name="startmonth">
									<option>1</option>
									<option>2</option>
									<option>3</option>
									<option>4</option>
									<option>5</option>
									<option>6</option>
									<option>7</option>
									<option>8</option>
									<option>9</option>
									<option>10</option>
									<option>11</option>
									<option>12</option>
								</select> 月 <select class="span1" name="startday">
									<option>1</option>
									<option>2</option>
									<option>3</option>
									<option>4</option>
									<option>5</option>
									<option>6</option>
									<option>7</option>
									<option>8</option>
									<option>9</option>
									<option>10</option>
									<option>11</option>
									<option>12</option>
									<option>13</option>
									<option>14</option>
									<option>15</option>
									<option>16</option>
									<option>17</option>
									<option>18</option>
									<option>19</option>
									<option>20</option>
									<option>21</option>
									<option>22</option>
									<option>23</option>
									<option>24</option>
									<option>25</option>
									<option>26</option>
									<option>27</option>
									<option>28</option>
									<option>29</option>
									<option>30</option>
									<option>31</option>
								</select> 日 <select class="span1" name="starthour">
									<option>0</option>
									<option>1</option>
									<option>2</option>
									<option>3</option>
									<option>4</option>
									<option>5</option>
									<option>6</option>
									<option>7</option>
									<option>8</option>
									<option>9</option>
									<option>10</option>
									<option>11</option>
									<option>12</option>
									<option>13</option>
									<option>14</option>
									<option>15</option>
									<option>16</option>
									<option>17</option>
									<option>18</option>
									<option>19</option>
									<option>20</option>
									<option>21</option>
									<option>22</option>
									<option>23</option>
								</select> 時 <select class="span1" name="startminute">
									<option>00</option>
									<option>15</option>
									<option>30</option>
									<option>45</option>
								</select> 分
							</div>
						</div>
						<div class="control-group">
							<label class="control-label" for="enddate">終了日</label>
							<div class="controls">
								<select class="yearbox" name="endyear">
									<option>2012</option>
									<option>2013</option>
									<option>2014</option>
									<option>2015</option>
								</select>年 <select class="span1" name="endmonth">
									<option>1</option>
									<option>2</option>
									<option>3</option>
									<option>4</option>
									<option>5</option>
									<option>6</option>
									<option>7</option>
									<option>8</option>
									<option>9</option>
									<option>10</option>
									<option>11</option>
									<option>12</option>
								</select> 月 <select class="span1" name="endday">
									<option>1</option>
									<option>2</option>
									<option>3</option>
									<option>4</option>
									<option>5</option>
									<option>6</option>
									<option>7</option>
									<option>8</option>
									<option>9</option>
									<option>10</option>
									<option>11</option>
									<option>12</option>
									<option>13</option>
									<option>14</option>
									<option>15</option>
									<option>16</option>
									<option>17</option>
									<option>18</option>
									<option>19</option>
									<option>20</option>
									<option>21</option>
									<option>22</option>
									<option>23</option>
									<option>24</option>
									<option>25</option>
									<option>26</option>
									<option>27</option>
									<option>28</option>
									<option>29</option>
									<option>30</option>
									<option>31</option>
								</select> 日 <select class="span1" name="endhour">
									<option>0</option>
									<option>1</option>
									<option>2</option>
									<option>3</option>
									<option>4</option>
									<option>5</option>
									<option>6</option>
									<option>7</option>
									<option>8</option>
									<option>9</option>
									<option>10</option>
									<option>11</option>
									<option>12</option>
									<option>13</option>
									<option>14</option>
									<option>15</option>
									<option>16</option>
									<option>17</option>
									<option>18</option>
									<option>19</option>
									<option>20</option>
									<option>21</option>
									<option>22</option>
									<option>23</option>
								</select> 時 <select class="span1" name="endminute">
									<option>00</option>
									<option>15</option>
									<option>30</option>
									<option>45</option>
								</select> 分
							</div>
						</div>
						<div class="form-actions">
							<button type="submit" class="btn btn-primary">登録</button>
						</div>
					</fieldset>
				</form>
				<c:forEach var="e" items="${autoPostVars}">
					<div class="schdule">
						<div class="schedule-button">
							<a
								href="/cockpit/schedule/edit?hour=${f:h(e.startHour)}&minute=${f:h(e.startMinute)}&id=${e.id}">編集</a>
							<a
								href="/cockpit/schedule/delete?hour=${f:h(e.startHour)}&minute=${f:h(e.startMinute)}&id=${e.id}"
								onclick="return confirm('削除してよろしいですか?')">削除</a>
						</div>
						<div class="schedule-date">${f:h(e.startYear)}年${f:h(e.startMonth)}月${f:h(e.startDay)}日
							${f:h(e.startHour)}時${f:h(e.startMinute)}分 ～
							${f:h(e.endYear)}年${f:h(e.endMonth)}月${f:h(e.endDay)}日${f:h(e.endHour)}時${f:h(e.endMinute)}分
							(${f:h(e.viewSchedules)})</div>
						<div class="schedule-tweet">${f:h(e.tweet)}</div>
					</div>
				</c:forEach>
			</div>
		</div>
	</div>
</body>
</html>
